package com.dxysun.design.memento;

public class Originator
{
	private String state;

	public String getState()
	{
		return state;
	}

	public void setState(String state)
	{
		this.state = state;
	}

	public Memento createMemento()
	{
		Memento memento = new Memento();
		memento.setState(state);
		return memento;
	}

	public void restoreMemento(Memento memento)
	{
		this.state = memento.getState();
	}

}
